import java.util.*;


public class Grade {
    /*
    * 自定义一个异常，继承自Exception
    * */
    public static class RangeException extends Exception {
        public RangeException(String message) {
            super(message);
        }
    }

    /*
    * 自定义范围异常
    * */
    static double checkRange(double score) throws RangeException {
        if ((int)score > 100 || ((int)score <= Double.MIN_VALUE && score != 0)) {
            throw new RangeException("请输入正确范围");
        }
        return score;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double score = 0;
        boolean is = true;
        do {
            is = true;
            System.out.println("请输入成绩");
            try {
                score = sc.nextDouble();
                checkRange(score);
            } catch (RangeException r) {//自定义范围异常
                is = false;
                System.err.println(r);
            } catch (Exception e) {
                is = false;
                System.err.println("格式错误，请重新输入成绩");
            }
        }while (!is);

        switch ((int) score / 10) {
            case 10:
            case 9:
                System.out.println("优秀");
                break;
            case 8:
                System.out.println("良好");
                break;
            case 7:
                System.out.println("中等");
                break;
            case 6:
                System.out.println("及格");
                break;
            default:
                System.out.println("不及格");
        }
    }
}

